[IA64] Supress warning of __assign_domain_page().
authorAlex Williamson <alex.williamson@hp.com>
Thu, 6 Sep 2007 15:05:26 +0000 (09:05 -0600)
committerAlex Williamson <alex.williamson@hp.com>
Thu, 6 Sep 2007 15:05:26 +0000 (09:05 -0600)
On Tiger, the following memory region triggers a warning.
It seems a false-positive warning caused by c/s 13123:90db0f68b121.
so suppress the warning in such a case.

EFI memory descriptor
(XEN) mem07: type= 5, attr=0x8000000000000009, range=[0x00000000000c0000-0x0000000000100000) (0MB)
type = EFI_RUNTIME_SERVICES_CODE
attribute = EFI_MEMORY_RUNTIME | EFI_MEMORY_WB | EFI_MEMORY_UC

from /proc/iomem
000a0000-000fffff : PCI Bus 0000:00
000c0000-000fffff : reserved

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Simon Horman <horms@verge.net.au>
xen/arch/ia64/xen/mm.c

index 6980736063ae8621386bc88a3bce7da6a65c5341..b3412d25195cddf05ed23c2735413b8e01c3eb4a 100644 (file)
@@ -868,15 +868,43 @@ __assign_domain_page(struct domain *d,
     // dom0 tries to map real machine's I/O region, but failed.
     // It is very likely that dom0 doesn't boot correctly because
     // it can't access I/O. So complain here.
-    if ((flags & ASSIGN_nocache) &&
-        (pte_pfn(ret_pte) != (physaddr >> PAGE_SHIFT) ||
-         !(pte_val(ret_pte) & _PAGE_MA_UC)))
-        printk("%s:%d WARNING can't assign page domain 0x%p id %d\n"
-               "\talready assigned pte_val 0x%016lx\n"
-               "\tmpaddr 0x%016lx physaddr 0x%016lx flags 0x%lx\n",
-               __func__, __LINE__,
-               d, d->domain_id, pte_val(ret_pte),
-               mpaddr, physaddr, flags);
+    if (flags & ASSIGN_nocache) {
+        int warn = 0;
+
+        if (pte_pfn(ret_pte) != (physaddr >> PAGE_SHIFT))
+            warn = 1;
+        else if (!(pte_val(ret_pte) & _PAGE_MA_UC)) {
+            u32 type;
+            u64 attr;
+
+            warn = 1;
+
+            /*
+             * See
+             * complete_dom0_memmap()
+             * case EFI_RUNTIME_SERVICES_CODE:
+             * case EFI_RUNTIME_SERVICES_DATA:
+             * case EFI_ACPI_RECLAIM_MEMORY:
+             * case EFI_ACPI_MEMORY_NVS:
+             * case EFI_RESERVED_TYPE:
+             * 
+             * Currently only EFI_RUNTIME_SERVICES_CODE is found
+             * so that we suppress only EFI_RUNTIME_SERVICES_CODE case.
+             */
+            type = efi_mem_type(physaddr);
+            attr = efi_mem_attributes(physaddr);
+            if (type == EFI_RUNTIME_SERVICES_CODE &&
+                (attr & EFI_MEMORY_UC) && (attr & EFI_MEMORY_WB))
+                warn = 0;
+        }
+        if (warn)
+            printk("%s:%d WARNING can't assign page domain 0x%p id %d\n"
+                   "\talready assigned pte_val 0x%016lx\n"
+                   "\tmpaddr 0x%016lx physaddr 0x%016lx flags 0x%lx\n",
+                   __func__, __LINE__,
+                   d, d->domain_id, pte_val(ret_pte),
+                   mpaddr, physaddr, flags);
+    }
 
     return -EAGAIN;
 }